﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<SDT.Site.ViewModels.VideoDetailViewModels>" %>
<%@ Import Namespace="SDT.Lib.Helpers" %>
<div class="bor_cor">
      	<div class="bar_org" align="center"><img align="absmiddle" src="/images/ftc/icon_tv.png" width="24" height="24" />&nbsp;<%=ViewData["Title"]%></div>
        <div align="center" class="tv_tivi">
            <% 
                string pathImage = "";
                string pathVideo = "";
                if (Model.Video.ImagePath != string.Empty)
                {
                    pathImage = SDT.Lib.Common.Utils.GenThumbnail(Model.Video.ID, 266, 186, Model.Video.ImagePath, Model.VideoImagePath, Model.VideoImageUrl);

                }
                else
                    pathImage = Model.VideoImageUrl + SDT.Lib.Common.Globals.DefaultLogo;
                pathVideo = Model.VideoFileUrl + Model.Video.ID + "_" + Model.Video.VideoPath;

                if (Model.Video.VideoPath != null && Model.Video.VideoPath != string.Empty)
                {
            %>
                <embed height="186" width="266" flashvars="file=<%=pathVideo%>&image=<%=pathImage%>&lightcolor=000000&frontcolor=000000"
                allowscriptaccess="always" allowfullscreen="true" quality="high" bgcolor="#FFFFFF"
                name="ply" id="ply" style="" src="/FlashPlayer/TSPlayer.swf" type="application/x-shockwave-flash" />
            <%}else %>
            <%if (Model.Video.Code != null && Model.Video.Code != string.Empty)
              { %>
              <div style="height:186px; width:266px; display:block; overflow:hidden">
                <%=Model.Video.Code %>
              </div>
            <%} %> 
        </div>  
        <div class="new_list">
  			 <ul>
                <%foreach (var item in Model.Videos)
                { %>
                <li><a href="/video/details/<%=item.ID %>/<%=Html.ToUrlFriendly(item.Name)%>"><%=Html.Encode(item.Name)%> &nbsp;(<%=item.AddDate.Value.ToString("dd/MM/yyyy") %>)</a> </li>
   	          <%} %>
    	   </ul> 
       	</div>  	
</div>
